package subject_set.lc200;

/**
 * @author haomin
 * @date 2022/12/26 20:44
 **/
public class Num26 {
    class Solution {
        public int removeDuplicates(int[] nums) {
            if(nums.length == 0) return 0;
            int l = 0, r = 1;
            for(; r < nums.length; ++r) {
                if(nums[l] != nums[r]) nums[++l] = nums[r];
            }
            return l + 1;
        }
    }
}